<!--{include header}-->
<script>
	
	//会员充值
	function chargeone(id)
	{
		var tot = new Date().getTime();
        var pm = {'id':id,'t':tot};
		var url = geturl('sysmember', 'charge', pm);
		floatPage(url, '充值', 360, 220, 'location.href=location.href');
		return false;
	}
	
	//确认删除会员
	function delone(id)
	{
		verify('你确定要删除该会员吗？', 'ajaxdelone("'+id+'")');
		return false;
	}
	
	//AJAX删除用户
	function ajaxdelone(id)
	{
		var pm = {'t':new Date().getTime()};
        var url = geturl('sysmember', 'del', pm);
        $.ajax({
			url: url,
			data: 'id='+id,
			type: 'post',
			dataType: 'html',
			success: function(res){
				//alert(res);
				if(res == 1){
					right('操作已成功！', 'location.href=location.href');
					//TINY.box.hide();
					//messageSuccess('操作已成功！');
					//location.href=location.href;
				}else if(res == 0){
					wrong('用户ID不能为空！');
				}else{
					wrong('系统异常，请联系管理员！');
				}
				return true;
			},
			error: function(){
				wrong('网络异常，请检查网络连接！');
				return false;
			}
		})
	}
	$(function(){
		$('input[type=checkbox][name=all_sel]').click(function(){
			var _allItems = $('input[type=checkbox][name=sel[]]');
			_allItems.attr('checked',$(this).attr('checked'));
		});
		$('input[type=checkbox][name=sel[]]').bind('itemChange',function(){
			var _allItems = $('input[type=checkbox][name=sel[]]');
			var _selected = $('input[type=checkbox][name=sel[]]:checked');	
			var _all_sel = $('input[type=checkbox][name=all_sel]');
			_all_sel.attr('checked',_allItems.length == _selected.length);	
		}).click(function(){
			$(this).trigger('itemChange');
		});
		$('.list_tbl tr').not($('.list_tbl tr').eq(0)).dblclick(function(){
			$('input[type=checkbox]',$(this)).attr('checked',!$('input[type=checkbox]',$(this)).attr('checked')).trigger('itemChange');
		}).hover(function(){
			$(this).css('cursor','pointer');
		});
	});
	

</script>
	<div class="rightmenu">
        <ul>
		<!--{include menu_right}-->
			<li class="act"><a href="javascript:;" onclick="addone()">导出</a></li>
		</ul>
	</div>
	<div class="workspace" id="workspace">
	<!--会员列表START-->
	<table cellspacing="0" cellpadding="0" border="0" class="list_tbl">
		<tr class="list_tit">
			<td ><input type="checkbox" name="all_sel"></td>
			<td width="40" class="first">ID</td>
            <td width="70">用户名</td>
			<td width="70">姓名</td>
            <td width="180">邮箱地址</td>
			<td width="100">城市</td>
			<td>账户余额</td>
			<td>账户积分</td>
            <td>上次登录信息</td>
            <td >注册时间</td>
			<td width="90">操作</td>
		</tr>
		<!--{if $members}-->
		<!--{loop $members $index $one}-->
		<tr class="tr_a">
			<td width="20"><input type="checkbox" name="sel[]" value="<{$one['id']}>"/></td>
			<td>{$one['id']}</td>
            <td>{$one['username']}</td>
            <td>{$one['realname']}</td>
            <td>{$one['email']}</td>
			<td>{$one['sys_citys_id']}</td>
			<td width="80">{$one['money']}</td>
			<td width="80">{$one['point']}</td>
            <td width="120">
            	<!--{if !$one['loginip'] || !$one['logintime']}-->
				未登录过
				<!--{else}-->
				{$one['loginip']}<br/>${date('Y-m-d H:i',$one['logintime'])}
				<!--{/if}-->
			</td>
            <td width="120">${date('Y-m-d H:i:s', $one['createtime'])}</td>
			<td>
				<a onclick="javascript:chargeone({$one['id']});return false;" href="javascript:;">充值</a> |
				<a onclick="javascript:delone({$one['id']});return false;" href="javascript:;">删除</a>
			</td>
		</tr>
		<!--{/loop}-->
		<!--{else}-->
		<tr class="tr_b">
			<td colspan="12" style="color:red">没有记录可以显示！</td>
		</tr>
		<!--{/if}-->
	</table>
	<!--会员列表END-->
	</div>
<!--{include footer}-->





